<template>
  <el-dialog @close="handleClose" title="详情" :visible.sync="openDetail" width="1000px" append-to-body v-dialogDrag>
    <el-card>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="任务号">{{
          form.taskNo
        }}</el-descriptions-item>
        <el-descriptions-item label="项目名称">{{
          form.projectName
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="用户">{{
          form.userName
        }}</el-descriptions-item>
        <el-descriptions-item label="类别">{{
          form.category
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="合同号">{{
          form.contractNumber
        }}</el-descriptions-item>
        <el-descriptions-item label="工质">{{
          form.productMedium
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="配置">{{
          form.unitLayout
        }}</el-descriptions-item>
        <el-descriptions-item label="轴流连接端">{{
          form.shaftConnection
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="静叶执行机构">{{
          form.bladeExecution
        }}</el-descriptions-item>
        <el-descriptions-item label="驱动机功率">{{
          form.driverPower
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="计算文件">{{
          form.calcFile
        }}</el-descriptions-item>
        <el-descriptions-item label="机型">{{
          form.productModel
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="转速r/min">{{
          form.speedRpm
        }}</el-descriptions-item>
        <el-descriptions-item label="启动角度">{{
          form.startupAngle
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="启动内功率">{{
          form.startupInternalPower
        }}</el-descriptions-item>
        <el-descriptions-item label="安全运行角">{{
          form.safeOperatingAngle
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="长期最小运行角">{{
          form.longTermMinOperatingAngle
        }}</el-descriptions-item>
        <el-descriptions-item label="最大静叶角度">{{
          form.maxStaticBladeAngle
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="2">
        <el-descriptions-item label="曲线名称">{{
          form.curveName
        }}</el-descriptions-item>
        <el-descriptions-item label="工况调节方式">{{
          form.adjustMode
        }}</el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" :column="1">
        <el-descriptions-item label="测频要求">
          <!-- <div v-html="form.frequencyRequire"></div> -->
        <div class="content-display">{{ form.frequencyRequire }}</div>
          </el-descriptions-item>
      
      </el-descriptions>
       <el-descriptions class="margin-top" :column="1">
       
        <el-descriptions-item label="备注信息"> <div class="content-display">{{ form.remark }}</div></el-descriptions-item>
      </el-descriptions>
      <!-- 大气压力 -->
      <!-- 工况点性能参数 -->
      <!-- 设计参数 -->
      <!-- 轴向推力 -->
      <!--  阻塞线信息-->
      <div class="titles">大气压力</div>
      <el-table :data="form.ttaskEnvList" ref="tProductFailureDetail" max-height="300" border>
        <el-table-column label="序号" align="center" type="index" width="50" />
        <el-table-column label="大气压力 kPa" prop="atmosphericPressure" min-width="150" show-overflow-tooltip
          align="center">
        </el-table-column>
        <el-table-column label="环境温度 ℃" prop="ambientTemperature" min-width="150" align="center" show-overflow-tooltip>
        </el-table-column>
        <el-table-column label="绝对温度 K" prop="absoluteTemperature" align="center" min-width="150" show-overflow-tooltip>
        </el-table-column>

        <el-table-column label="绝对湿度 mb" align="center" prop="absoluteHumidity" min-width="150" show-overflow-tooltip>
        </el-table-column>
        <el-table-column label="相对湿度 %" align="center" prop="relativeHumidity" min-width="150" show-overflow-tooltip>
        </el-table-column>
      </el-table>
      <div class="titles">工况点性能参数</div>
      <el-table :data="form.ttaskPerformancePointList" ref="tProductFailureDetail" max-height="300" border>
        <el-table-column label="序号" align="center" type="index" width="50" />
        <el-table-column label="工况点" align="center" prop="performanceName" min-width="150" show-overflow-tooltip />
        <el-table-column label="工作转速 r/min" align="center" prop="workSpeed" min-width="150" show-overflow-tooltip />
        <el-table-column label="静叶角度 °" align="center" prop="guideVaneAngle" min-width="150" show-overflow-tooltip />
        <el-table-column label="多变效率" align="center" prop="polyEfficiency" min-width="150" show-overflow-tooltip />
        <el-table-column label="内功率" align="center" prop="internalPower" min-width="150" show-overflow-tooltip />
        <el-table-column label="出口温度" align="center" prop="outletTempK" min-width="150" show-overflow-tooltip />
        <el-table-column label="出口温度" align="center" prop="outletTempC" min-width="150" show-overflow-tooltip />
        <el-table-column label="轴功率 kW" align="center" prop="shaftPower" min-width="150" show-overflow-tooltip />
        <el-table-column label="轴功率 kW(修正)" align="center" prop="shaftPowerCorrected" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="内功率 kW(修正)" align="center" prop="internalPowerCorrected" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="出口温度 ℃" align="center" prop="outletTempCorrected" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="多变效率 %" align="center" prop="polyEfficiencyCorrected" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="多变效率修正量 %" align="center" prop="polyEfficiencyDelta" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="等熵效率 %" align="center" prop="isentropicEfficiency" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="多变能量头 kJ/kg" align="center" prop="polyEnergyHead" min-width="150"
          show-overflow-tooltip />
      </el-table>
      <div class="titles">设计参数</div>
      <el-table :data="form.ttaskConditionParamList" ref="tProductFailureDetail" max-height="300" border>
        <el-table-column label="序号" align="center" type="index" width="50" />
        <el-table-column label="工况点编号" align="center" prop="conditionCode" min-width="150" show-overflow-tooltip />
        <el-table-column label="气体常数 R (kJ/kg·K)" align="center" prop="gasConstantR" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="含湿量 X (kg/kg)" align="center" prop="humidityRatioX" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="压比" align="center" prop="compressionRatio" min-width="150" show-overflow-tooltip />
        <el-table-column label="入口态体积流量 (m³/min)" align="center" prop="inletFlowActualM3Min" min-width="180"
          show-overflow-tooltip />
        <el-table-column label="标态流量(干) (Nm³/min)" align="center" prop="standardFlowDryNm3Min" min-width="180"
          show-overflow-tooltip />
        <el-table-column label="标态流量(湿) (Nm³/min)" align="center" prop="standardFlowWetNm3Min" min-width="180"
          show-overflow-tooltip />
        <el-table-column label="标态流量(湿) (Nm³/h)" align="center" prop="standardFlowWetNm3H" min-width="180"
          show-overflow-tooltip />
        <el-table-column label="质量流量(干) (kg/s)" align="center" prop="massFlowDryKgS" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="质量流量(湿) (kg/s)" align="center" prop="massFlowWetKgS" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="质量流量(干) (T/h)" align="center" prop="massFlowDryTH" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="进气法兰处压力 pj (bar a)" align="center" prop="inletPressurePjBarA" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="进气温度 Tj (℃)" align="center" prop="inletTempTjC" min-width="150" show-overflow-tooltip />
        <el-table-column label="进气温度 Tj (K)" align="center" prop="inletTempTjK" min-width="150" show-overflow-tooltip />
        <el-table-column label="相对湿度 (%)" align="center" prop="relativeHumidity" min-width="150"
          show-overflow-tooltip />
        <el-table-column label="排气法兰处压力 (bar a)" align="center" prop="outletPressureBarA" min-width="180"
          show-overflow-tooltip />
        <el-table-column label="排气法兰处压力 (kgf/cm² G)" align="center" prop="outletPressureKgfCm2G" min-width="200"
          show-overflow-tooltip />
      </el-table>
      <div class="titles">轴向推力</div>
      <el-table :data="form.ttaskThrustList" ref="tProductFailureDetail" max-height="300" border>
        <el-table-column label="序号" align="center" type="index" width="50" />
        <el-table-column label="名称" prop="performanceName" min-width="150" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column label="纯气流力 kN" prop="pureGasForce" min-width="150" show-overflow-tooltip align="center">
        </el-table-column>
        <el-table-column label="F（有平衡管） kN" prop="forceWithBalancePipe" min-width="150" show-overflow-tooltip
          align="center">
        </el-table-column>
        <el-table-column label="F（无平衡管） kN" prop="forceWithoutBalancePipe" min-width="150" show-overflow-tooltip
          align="center">
        </el-table-column>
      </el-table>
      <div class="titles">阻塞线信息</div>
      <el-table :data="form.ttaskBlockLineList" ref="tProductFailureDetail" max-height="300" border>
        <el-table-column label="序号" align="center" type="index" width="50" />
        <el-table-column label="角度(°)" prop="angle" min-width="150" align="center">
        </el-table-column>
        <el-table-column label="排气法兰处压力" prop="dischargePressure" align="center" min-width="150">
        </el-table-column>
      </el-table>
    </el-card>
  </el-dialog>
</template>
<script>
import { getTaskInfo } from "@/api/fileManage/entering";
export default {
  props: ["detailsId", "openView"],
  data() {
    return {
      form: {},
      openDetail: false,
    };
  },
  created() {
    console.log(this.openView)
  },
  // watch: {
  //   detailsId: {
  //     immediate: true,
  //     handler(newVal) {
  //       if (newVal) {
  //         this.handleDetail();
  //       }
  //     },
  //   },
  // },
  methods: {
     handleClose() {
      this.openDetail = false;
      this.$emit('close');  // 可选：通知父组件
    },
    handleDetail() {
      getTaskInfo(this.detailsId).then((response) => {
        this.form = response.data;
        this.openDetail = true;
      });
    },
  },
};
</script>
<style scoped lang="scss">
.titles {
  margin: 15px 0;
  border-left: 3px solid #0275cd;
  padding-left: 10px;
  font-size: 16px;
  font-weight: bold;

}
.content-display {
  white-space: pre-wrap;  /* 保留换行和空格，自动换行 */
  word-wrap: break-word;  /* 长单词换行 */
}
</style>
